<?php
include_once 'fun.php';
include_once 'islogin.php';
    //var_dump($_FILES);
    $_SESSION['isadmin']=isset($_SESSION['isadmin'])?$_SESSION['isadmin']:'';
    if ($_SESSION['isadmin']!=3&&$_SESSION['isadmin']!=-1) {
        header('Refresh:1;url=shop.php');
        die("请以人力管理员身份登录");
    }
    $Name = trim($_POST['Name']);
    $gender = ($_POST['gender']!='')?$_POST['gender']:'';
    $age =($_POST['age']!='')?trim($_POST['age']):'';
   // $pic='pics/default.PNG';
    if(empty($Name))
    {
    header('Refresh:0;url=stuff.php');
    die("姓名不能为空");
    }
    else
    {
        $con=connect();
        $sql = "insert into manager (Name) values ('{$Name}')";
        query($sql,$con);
    echo "<script>
        location.href='stuff.php';
</script>";
    
    }
    
    
?>